angular.module('starter.controllers', [])
// 首页
.controller('DashCtrl', function($scope) {
$.get('https://api.tianapi.com/social/?key=3f4962074626414eb1b25cb279e4465a&num=50',null,function(data){
	console.log(data)
	$scope.data=data.newslist
})
})// 科技
.controller('contentCtrl', function($scope) {
    $.get('https://api.tianapi.com/mobile/?key=3f4962074626414eb1b25cb279e4465a&num=50',null,function(data){
    	console.log(data)
    	var m=data.newslist
    	console.log(m)
    	$scope.m=m
    })
    
	})
	// 图片
.controller('tupianCtrl', function($scope) {
$.get('https://api.tianapi.com/huabian/?key=3f4962074626414eb1b25cb279e4465a&num=50',null,function(data){
	console.log(data)
	$scope.data=data.newslist
})
})

.controller('ChatsCtrl', function($scope, Chats) {
	// With the new view caching in Ionic, Controllers are only called
	// when they are recreated or on app start, instead of every page change.
	// To listen for when this page is active (for example, to refresh data),
	// listen for the $ionicView.enter event:
	//
	//$scope.$on('$ionicView.enter', function(e) {
	//});

	$scope.chats = Chats.all();
	$scope.remove = function(chat) {
		Chats.remove(chat);
	};
})
// 标题
.controller('ChatDetailCtrl', function($scope, $stateParams, Chats) {
	$scope.chat = Chats.get($stateParams.chatId);
})

// 设置
.controller('AccountCtrl', function($scope) {

		$scope.settings = {
			enableFriends: true
		};
	})
	